package com.mashibing.controller;

import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.request.PointRequest;
import com.mashibing.internalcommon.response.TerminalResponse;
import com.mashibing.internalcommon.response.TrackResponse;
import com.mashibing.service.AddTrackService;
import com.mashibing.service.TerminalMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TrackController {

    @Autowired
    private AddTrackService addTrackService;

    /**
     * 添加轨迹
     * @param tid
     * @return
     */
    @PostMapping("/addTrack")
    public ResponseResult<TrackResponse> addTrack(String tid) {
        return addTrackService.addTrack(tid);
    }

    /**
     * 上传轨迹
     * @param pointRequest
     * @return
     */
    @PostMapping("/uploadTrack")
    public ResponseResult uploadTrack(@RequestBody PointRequest pointRequest) {
        return addTrackService.uploadTrack(pointRequest);
    }
}
